import { createStore } from 'redux'
import { applyMiddleware } from 'redux'
import { composeWithDevTools } from 'redux-devtools-extension'
import reducer from './reducer'
import thunk from 'redux-thunk'
import { getToken } from '@/utils/storage'
//参数一:reducer
//参数二:初始值,获取token
//参数三:中间件
const store = createStore(
  reducer,
  {
    login: {
      token: getToken(),
    },
  },
  composeWithDevTools(applyMiddleware(thunk))
)
export default store
